package com.chendechao.model_home.ui

import com.chendechao.lib_base.BaseRepository
import javax.inject.Inject

class HomeRepository @Inject constructor() :BaseRepository(){

    @Inject
    lateinit var homeApiService: HomApiService

    suspend fun getTabLayoutData() :Result<HomeUIState> {
        val simpleType = homeApiService.getTabLayoutData()
        return if (simpleType.code==200){
            Result.success(HomeUIState(simpleType = simpleType.data, isSucess = true))
        }else{
            Result.failure(IllegalArgumentException("没有数据"))
        }
    }
}